package com.shop2cn.iapi.sqoptrade.resp;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class TradingServiceResp {

	private long mainOrderId;

	private long userId;

	private String bizId;

	private List<Order> orderList = new ArrayList<Order>();

	public long getTradingId() {
		return mainOrderId;
	}

	public long getMainOrderId() {
		return mainOrderId;
	}

	public void setMainOrderId(long mainOrderId) {
		this.mainOrderId = mainOrderId;
	}

	/**
	 * 主订单维度 用户支付金额
	 */
	public BigDecimal getPayableAmount() {
		return orderList.stream()
				.map(order -> order.getOrderPo().getPayableAmount())
				.reduce(BigDecimal.ZERO, BigDecimal::add);
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public List<Order> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<Order> orderList) {
		this.orderList = orderList;
	}

	public String getBizId() {
		return bizId;
	}

	public void setBizId(String bizId) {
		this.bizId = bizId;
	}

}
